package info.nene_loveplus.util;

import java.io.StringWriter;

import org.eclipse.mylyn.wikitext.core.parser.MarkupParser;
import org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder;
import org.eclipse.mylyn.wikitext.tracwiki.core.TracWikiLanguage;

public class WikiUtil {

	private WikiUtil() {
	}

	public static String toHtml(String wiki) {
		StringWriter out = new StringWriter();

		HtmlDocumentBuilder builder = new HtmlDocumentBuilder(out, true);
		MarkupParser parser = new MarkupParser(new TracWikiLanguage(), builder);
		parser.parse(wiki, false);

		return out.toString();
	}
}
